
package ro.qi.framework.sys.security.entities;

import ro.qi.framework.sys.entities.Entity;

public class SecurityAccountCollection extends Entity {

	public SecurityAccountCollection() {
		select();
	}

	public SecurityAccountCollection(String searchQuery) {
		super();
		setLogin(searchQuery);
		setEmail(searchQuery);
		setFirstName(searchQuery);
		setFamilyName(searchQuery);
		select();
	}

	public void setLogin(String value) {
		setValue("login", value);
	}

	public void setEmail(String value) {
		setValue("email", value);
	}

	public void setFirstName(String value) {
		setValue("firstName", value);
	}

	public void setFamilyName(String value) {
		setValue("familyName", value);
	}

	public int getCollectionSize() {
		return getCollectionSize("accounts");
	}
	
	public int getId(int index) {
		return getCollectionIntValue("accounts", "id", index);
	}

	public SecurityAccount getAccount(int index) {
		return new SecurityAccount(getId(index));
	}
	
}
